<?php
// +----------------------------------------------------------------------
// | [ WE ONLY DO WHAT IS NECESSARY ]
// +----------------------------------------------------------------------
// | Author < 931274989@qq.com >
// +----------------------------------------------------------------------
// | Explain 机油日志
// +----------------------------------------------------------------------
namespace app\admin\controller;

use app\model\JiyouLog as JiyouLogModel;
use think\Controller;
use think\Db;
 
class  JiyouLog extends Controller
{
  public function lst()
  {
    $model = new JiyouLogModel();
    $jiyoulog = $model::with('user','xiche','jiyou','order')->order('id desc')->paginate(20);
    $this->assign('jiyoulog',$jiyoulog);
    return view();
  }

  public function del()
  {
    if($this->request->isAjax()) {
      $id = $this->request->has('id') ? $this->request->param('id', 0, 'intval') : 0;
      if(false == Db::name('jiyou_log')->where('id',$id)->delete()) {
        return $this->error('删除失败');
      } else {
        return $this->success('删除成功','jiyouLog/lst');
      }
    }
  }
}
?>